# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Metastore.V1beta.Model.CloudSQLMigrationConfig do
  @moduledoc """
  Configuration information for migrating from self-managed hive metastore on Google Cloud using Cloud SQL as the backend database to Dataproc Metastore.

  ## Attributes

  *   `cdcConfig` (*type:* `GoogleApi.Metastore.V1beta.Model.CdcConfig.t`, *default:* `nil`) - Required. Configuration information to start the Change Data Capture (CDC) streams from customer database to backend database of Dataproc Metastore. Dataproc Metastore switches to using its backend database after the cutover phase of migration.
  *   `cloudSqlConnectionConfig` (*type:* `GoogleApi.Metastore.V1beta.Model.CloudSQLConnectionConfig.t`, *default:* `nil`) - Required. Configuration information to establish customer database connection before the cutover phase of migration
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cdcConfig => GoogleApi.Metastore.V1beta.Model.CdcConfig.t() | nil,
          :cloudSqlConnectionConfig =>
            GoogleApi.Metastore.V1beta.Model.CloudSQLConnectionConfig.t() | nil
        }

  field(:cdcConfig, as: GoogleApi.Metastore.V1beta.Model.CdcConfig)
  field(:cloudSqlConnectionConfig, as: GoogleApi.Metastore.V1beta.Model.CloudSQLConnectionConfig)
end

defimpl Poison.Decoder, for: GoogleApi.Metastore.V1beta.Model.CloudSQLMigrationConfig do
  def decode(value, options) do
    GoogleApi.Metastore.V1beta.Model.CloudSQLMigrationConfig.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Metastore.V1beta.Model.CloudSQLMigrationConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
